{% extends 'base.html' %}
{% load static %}
      {% block body %}
        <div>
            <div class="container">
                <div style="margin-bottom: 10px;margin-top: -10px;">
                    <a style="border: 1px solid black;padding: 5px;border-radius: 3px;color: green;" href="/user/add/"><span class="glyphicon glyphicon-plus-sign"></span>添加客户</a>
                </div>
                <div class="panel panel-default" style="background-color: rgb(241, 238, 233);">
                    <div class="panel-heading">
                        <span class="glyphicon glyphicon-th-list"></span>
                        用户信息</div>
                    <table class="table">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th>姓名</th>
                                <th>年龄</th>
                                <th>性别</th>
                                <th>账户</th>
                                <th>所属部门</th>
                                <th>入职日期</th>
                                <th>变动日期</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for user in queryset %}
                            <tr>
                                <td>{{forloop.counter}}</td>
                                <td>{{user.name}}</td>
                                <td>{{user.age}}</td>
                                <td>{{user.get_gender_display}}</td>
                                <td>{{user.account}}</td>
                                <td>{{user.department.title}}</td>
                                <td>{{user.create_time|date:"Y-m-d"}}</td>
                                <td>{{user.update_time|date:"Y-m-d"}}</td>
                                <td>
                                    <a style="border: 1px solid black;padding: 1px;border-radius: 3px;" href="/user/edit/{{user.id}}/">
                                        <span class="glyphicon glyphicon-edit">编辑</span>
                                    </a>
                                    <a style="border: 1px solid black;padding: 1px;border-radius: 3px;color: red;margin-left: 5px;" href="/user/delete/?nid={{user.id}}">
                                        <span class="glyphicon glyphicon-minus-sign">删除</span>
                                    </a>
                                </td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
      {% endblock body %}
